<template>
  <div class="home" >
    <!-- 轮播图 -->
    <div class="lunbo">
      <el-carousel height="1000px">
        <el-carousel-item>
          <img src="../assets/img/bantou.png" alt="Carousel Image"
            style="width: 100%; height: 100%; object-fit: cover;">
        </el-carousel-item>
        <el-carousel-item>
          <img src="../assets/img/bantou1.png" alt="Carousel Image"
            style="width: 100%; height: 100%; object-fit: cover;">
        </el-carousel-item>
        <el-carousel-item>
          <img src="../assets/img/bantou2.png" alt="Carousel Image"
            style="width: 100%; height: 100%; object-fit: cover;">
        </el-carousel-item>
        <el-carousel-item>
          <img src="../assets/img/bantou3.png" alt="Carousel Image"
            style="width: 100%; height: 100%; object-fit: cover;">
        </el-carousel-item>
      </el-carousel>
    </div>
    <div class="videoMode">
    <video ref="videoPlayer" src="../video/萃元资质.mp4" controls width="840" height="460"></video>
    <button class="playButton" :class="{ 'hide': !showPlayButton }" @click="playVideo">
      <div class="triangle"></div>
    </button>
  </div>
  </div>
</template>

<script>
// import { swiper, swiperSlide } from "vue-awesome-swiper";
export default {
  name: "HelloWorld",
  components: {
  },
  data () {
    return {
      showPlayButton: true,
      loading: true,
      showTriangle: true,
      caseList: [],
      newsList: [],
    };
  },
  created () {

  },
  // 如果你需要得到当前的swiper对象来做一些事情，你可以像下面这样定义一个方法属性来获取当前的swiper对象，同时notNextTick必须为true
  computed: {
   
  },
  mounted () {
    // this.caseList = [
    //   {
    //     Id: 42,
    //     Content: '紫苏籽油',
    //     Image: '../../src/assets/img/logo.png',
    //     Title: '黑龙江萃元生物科技',
    //     CreateTime: time.toLocaleTimeString()
    //   }
    // ]
  },
  methods: {
    playVideo() {
      const video = this.$refs.videoPlayer;
      video.play();
      this.showPlayButton = false;
    }
  }
};
</script>

<style lang="scss" scoped>
/* .el-header {
  position: absolute;
} */

.el-carousel__indicators button {
  width: 10px;
  /* 设置圆形指示器的宽度 */
  height: 10px;
  /* 设置圆形指示器的高度 */
  border-radius: 50%;
  /* 将方形指示器变成圆形 */
  margin: 0 5px;
  /* 设置圆形指示器之间的间距 */
  background-color: rgba(0, 0, 0, 0.5);
  /* 设置圆形指示器的颜色 */
}

.lunbo {
  margin-bottom: 110px;
}
//未进入此页面的样式
::v-deep .el-carousel__button {
  width: 19px;
  height: 19px;
  background: #cbd9e2;
  border-radius: 50%;
  opacity: 1;
}
//滚动到此页面的样式
::v-deep .is-active .el-carousel__button {
  width: 19px;
  height: 19px;
  background: #0fc6c2;
  border-radius: 50%;
  opacity: 1;
}
.el-carousel__indicator--horizontal {
    display: inline-block;
    padding: 12px 10px !important;
}
.videoMode{
  text-align: center;
}
.videoMode {
  position: relative;
}

.playButton {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  border: none;
  border-radius: 50%;
  background-color: #f00; /* 设置按钮背景颜色 */
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.5s; /* 添加过渡效果 */
  
}

.triangle {
  position: relative;
  left: 5px;
  width: 0;
  height: 0;
  border-top: 20px solid transparent;
  border-bottom: 20px solid transparent;
  border-left:40px solid #fff; /* 设置三角形颜色 */
  transition: all 0.5s; /* 添加过渡效果 */
}
.hide {
  opacity: 0;
  transform: translate(-50%, -200%);
}

</style>
